<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root 
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
	version="2.0">
    <jsp:directive.page language="java"
        contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" />
    <jsp:text>
        <![CDATA[ <?xml version="1.0" encoding="UTF-8" ?> ]]>
    </jsp:text>
    <jsp:text>
        <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ]]>
    </jsp:text>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<c:url var="scriptUrl" value="/scripts/dayOfEntries.js"/>
<script type="text/javascript" src="${scriptUrl}"><!--  //--></script>
<title>Daily Time Entry</title>
</head>
<body>

	<div class="date-control">
		<a title="Go Back A Week" href="?day=${dateinfo.minusWeek}">&lt;&lt;</a>
		<jsp:text><![CDATA[&nbsp;]]></jsp:text>
		<a title="Go Back A Day" href="?day=${dateinfo.minusDay}">&lt;</a>
		<span><jsp:text><![CDATA[&nbsp;]]></jsp:text>
			<fmt:formatDate value="${dateinfo.day}"/>
		<jsp:text><![CDATA[&nbsp;]]></jsp:text></span>
		<a title="Go Forward A Day" href="?day=${dateinfo.plusDay}">&gt;</a>
		<jsp:text><![CDATA[&nbsp;]]></jsp:text>
		<a title="Go Forward A Week" href="?day=${dateinfo.plusWeek}">&gt;&gt;</a>
	</div>

	<div class="day-entries">
		<jsp:include page="/WEB-INF/pages/components/entryTable.jsp"/>
	</div>
	

<c:set var="addEntryParams"><c:if test="${param.day ne null}">?day=${param.day}</c:if></c:set>
<form id="addentry" action="/addEntry.html${addEntryParams}" method="post">
	<fieldset>
		<legend>Add a new entry</legend>
		<ul>
			<li class="label">
				Project
			</li>
			<li class="input">
				<select name="entry.projectId" id="new-project">
					<option></option>
					<c:forEach items="${projects}" var="project">
						<option value="${project.id}">
							${project.name}
						</option>
					</c:forEach>
				</select>
			</li>
			
			<li class="label">
				Category
			</li>
			<li class="input">
				<select name="entry.categoryId" id="new-category">
				</select>
			</li>
			
			<li class="label">
				Description
			</li>
			<li class="input">
				<input name="entry.description" type="text"/>
			</li>
			
			<li class="label">
				Time (h:mm)
			</li>
			<li class="input">
				<input name="entry.count" type="text"/>
			</li>
			<li class="submit">
				<input type="submit" value="Add"/>
			</li>
		</ul>
		
	</fieldset>
</form>
<jsp:text>
<![CDATA[<script type="text/javascript">
<!--
	CATEGORIES = ${categoryJson};
	DAY = "${param.day}";
//-->
</script>]]>
</jsp:text>
</body>
</html>
</jsp:root>